/* index.ts */
import request from '@/utils/request'

export function videoApi() {
  return {
    /** 获取视频标签列表 */
    getVideoGroupList: (params) => {
      return request({
        url: '/video/group/list',
        method: 'get',
        params
      })
    },
    /** 获取视频标签/分类下的视频 */
    getVideoList: (params) => {
      return request({
        url: '/video/group',
        method: 'get',
        params
      })
    },

    /** 获取全部视频列表 */
    getAllVideoList: (params) => {
      return request({
        url: '/video/timeline/all',
        method: 'get',
        params
      })
    },

    /** 获得视频详情 */
    getVideoDetails: (params) => {
      return request({
        url: '/video/detail',
        method: 'get',
        params
      })
    },
    /** 获得视频相关推荐 */
    getRelatedVideo: (params) => {
      return request({
        url: '/related/allvideo',
        method: 'get',
        params
      })
    },
    /** 获得视频评论 */
    getVideoComments: (params) => {
      return request({
        url: '/comment/video',
        method: 'get',
        params
      })
    },
    /** 获得视频播放地址 */
    getVideoPlayUrl: (params) => {
      return request({
        url: '/video/url',
        method: 'get',
        params
      })
    },
    /** 资源点赞( MV,电台,视频) */
    likeResources: (params) => {
      return request({
        url: '/resource/like',
        method: 'get',
        params
      })
    }
  }
}
